package com.wangsh.userscenter.users.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 角色的POJO
 * 
 * @author WangshSxt
 *
 */
public class ARole implements Serializable
{
	private int id;
	private int createId ; 
	private int updateId ; 
	private String name;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime ; 
	
	/* 关联对象 */
	private List<AAdmins> adminsList ;
	private AAdmins createAdmins ; 
	private AAdmins updateAdmins ;
	
	/* 字符串描述 */
	private String statusStr ; 

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public List<AAdmins> getAdminsList()
	{
		return adminsList;
	}

	public void setAdminsList(List<AAdmins> adminsList)
	{
		this.adminsList = adminsList;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public String getStatusStr()
	{
		/*
		 * 循环枚举
		 */
		ARoleEnum[] roleEnums = ARoleEnum.values();
		for (int i = 0; i < roleEnums.length; i++)
		{
			ARoleEnum adminsEnum = roleEnums[i];
			/* 一个表中有多个byte类型的字段(枚举)
			 * 不同的byte字段可以有相同的值,
			 * 所以在判断的时候,即要判断值,又要判断名称
			 *  */
			if(this.getStatus() == adminsEnum.getStatus() && adminsEnum.toString().startsWith("STATUS"))
			{
				this.statusStr = adminsEnum.getInfo() ; 
			}
			/*ConstatFinalUtil.SYS_LOGGER.info("info:{},status:{},属性名:{}",
					adminsEnum.getInfo(),adminsEnum.getStatus(),adminsEnum);*/
		}
		return statusStr;
	}

	public int getCreateId()
	{
		return createId;
	}

	public void setCreateId(int createId)
	{
		this.createId = createId;
	}

	public AAdmins getCreateAdmins()
	{
		return createAdmins;
	}

	public void setCreateAdmins(AAdmins createAdmins)
	{
		this.createAdmins = createAdmins;
	}

	public AAdmins getUpdateAdmins()
	{
		return updateAdmins;
	}

	public void setUpdateAdmins(AAdmins updateAdmins)
	{
		this.updateAdmins = updateAdmins;
	}

	public int getUpdateId()
	{
		return updateId;
	}

	public void setUpdateId(int updateId)
	{
		this.updateId = updateId;
	}

	
}
